<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>test!</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书FM,电台">
    <meta name="description" content="">
    <meta name="keywords" content="音乐,情感">
    <script src="{{ asset('/scripts/ximalaya/xmsdk.min.js') }}"></script>
    <script src="{{ asset('/scripts/ximalaya/vue.min.js') }}"></script>
</head>
<body>
<div class="page">
    <h2 style="color:red">点播内容api</h2>

    <h1>分类列表 /categories/list</h1>
    <div id="categories_list">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
      </ol>
    </div>    

    <h1>标签列表(0-专辑标签，1-声音标签) /v2/tags/list</h1>
    <div id="v2_tags_list">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>专辑列表 /v2/albums/list</h1>
    <div id="v2_albums_list">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>专辑浏览 /albums/browse</h1>
    <div id="albums_browse">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取专辑信息 /albums/get_batch</h1>
    <div id="albums_get_batch">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取专辑更新信息 /albums/get_update_batch</h1>
    <div id="albums_get_update_batch">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取声音信息 /tracks/get_batch</h1>
    <div id="tracks_get_batch">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某条声音在专辑内所属声音页信息列表 /tracks/get_last_play_tracks</h1>
    <div id="tracks_get_last_play_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某个分类下的元数据列表 /metadata/list</h1>
    <div id="metadata_list">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取元数据下的专辑列表 /metadata/albums</h1>
    <div id="metadata_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取专辑榜单列表 /v3/ranks/index_list</h1>
    <div id="v3_ranks_index_list">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取专辑榜单详情 /v3/ranks/albums</h1>
    <div id="v3_ranks_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h2 style="color:red">内容运营api</h2>

    <h1>运营分类列表 /operation/categories</h1>
    <div id="operation_categories">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>运营维度列表 /operation/dimensions</h1>
    <div id="operation_dimensions">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某个维度下的标签列表 /operation/tags_of_dimension</h1>
    <div id="operation_tags_of_dimension">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>运营标签列表 /operation/dimension_tags</h1>
    <div id="operation_dimension_tags">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>多筛选条件搜索听单 /operation/columns</h1>
    <div id="operation_columns">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取听单信息 /operation/batch_get_columns</h1>
    <div id="operation_batch_get_columns">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>分页获取听单内容 /operation/browse_column_content</h1>
    <div id="operation_browse_column_content">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>多筛选条件搜索专辑 /operation/developer_collected_albums</h1>
    <div id="operation_developer_collected_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>多筛选条件搜索焦点图 /operation/banners</h1>
    <div id="operation_banners">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    
</div> 

<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->


<script>
    const { config } = window.xmsdk;

    config({
        app_key: '5e3de3aa76d5201658463c03abf6fbc1', 
        sig_url: 'http://www.yedushu.com/yefm/jssdk_sig', 
        device_id: 'u0sdfu09s80f9809sdf8908sfk', 
        timeout: 10 * 1000,
        debug: true
    });

    const { XMLY, XMplayer } = window.xmsdk;
    const xmly = new XMLY();    

    //分类列表
    xmly.request({
        url: 'https://api.ximalaya.com/categories/list',
        type: 'get',
        params: {
            
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#categories_list',
            data: {
                rows: res
            }
        });   
    }); 

    //标签列表 
    xmly.request({
        url: 'https://api.ximalaya.com/v2/tags/list',
        type: 'get',
        params: {
            category_id: 3,
            type: 0,
            
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_tags_list',
            data: {
                rows: res
            }
        });   
    }); 

    // 专辑列表
    xmly.request({
        url: 'https://api.ximalaya.com/v2/albums/list',
        type: 'get',
        params: {
            category_id: 3,
            tag_name: 0,
            calc_dimension: 1,
            page: 1,
            count: 2,
            contains_paid: true,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_albums_list',
            data: {
                rows: res
            }
        });   
    });

    // 专辑浏览
    xmly.request({
        url: 'https://api.ximalaya.com/albums/browse',
        type: 'get',
        params: {
            album_id: '19092426',
            sort: 'asc',
            page: 1,
            count: 20,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#albums_browse',
            data: {
                rows: res
            }
        });   
    });

    // 批量获取专辑信息
    xmly.request({
        url: 'https://api.ximalaya.com/albums/get_batch',
        type: 'get',
        params: {
            ids: '19092426',
            with_metadata: true,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#albums_get_batch',
            data: {
                rows: res
            }
        });   
    });

    // 批量获取专辑更新信息
    xmly.request({
        url: 'https://api.ximalaya.com/albums/get_update_batch',
        type: 'get',
        params: {
            ids: '23465401',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#albums_get_update_batch',
            data: {
                rows: res
            }
        });   
    });

    // 批量获取声音信息
    xmly.request({
        url: 'https://api.ximalaya.com/tracks/get_batch',
        type: 'get',
        params: {
            ids: '133177088',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#tracks_get_batch',
            data: {
                rows: res
            }
        });   
    });

    // 获取某条声音在专辑内所属声音页信息列表
    xmly.request({
        url: 'https://api.ximalaya.com/tracks/get_last_play_tracks',
        type: 'get',
        params: {
            album_id: '18208623',
            track_id: '123392744',
            count: 1,
            sort: 'asc',
            contains_paid: true,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#tracks_get_last_play_tracks',
            data: {
                rows: res
            }
        });   
    });

    // 获取某个分类下的元数据列表
    xmly.request({
        url: 'https://api.ximalaya.com/metadata/list',
        type: 'get',
        params: {
            category_id: '15',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#metadata_list',
            data: {
                rows: res
            }
        });   
    });

    // 获取元数据下的专辑列表
    xmly.request({
        url: 'https://api.ximalaya.com/metadata/albums',
        type: 'get',
        params: {
            category_id: '40',
            metadata_attributes: '19:都市',
            calc_dimension: 1,
            // page: 1,
            // count: 20,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#metadata_albums',
            data: {
                rows: res
            }
        });   
    });

    // 获取专辑榜单列表
    xmly.request({
        url: 'https://api.ximalaya.com/v3/ranks/index_list',
        type: 'get',
        params: {
            rank_type: '1',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v3_ranks_index_list',
            data: {
                rows: res
            }
        });   
    });

    // 获取专辑榜单详情
    xmly.request({
        url: 'https://api.ximalaya.com/v3/ranks/albums',
        type: 'get',
        params: {
            rank_list_id: '1',
            page: 1,
            count: 20,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v3_ranks_albums',
            data: {
                rows: res
            }
        });   
    });

    // <h2>内容运营api</h2>

    // 运营分类列表
    xmly.request({
        url: 'https://api.ximalaya.com/operation/categories',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_categories',
            data: {
                rows: res
            }
        });   
    });

    // 运营维度列表
    xmly.request({
        url: 'https://api.ximalaya.com/operation/dimensions',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_dimensions',
            data: {
                rows: res
            }
        });   
    });

    // 获取某个维度下的标签列表
    xmly.request({
        url: 'https://api.ximalaya.com/operation/tags_of_dimension',
        type: 'get',
        params: {
            id: 109,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_tags_of_dimension',
            data: {
                rows: res
            }
        });   
    });

    // 运营标签列表
    xmly.request({
        url: 'https://api.ximalaya.com/operation/dimension_tags',
        type: 'get',
        params: {
            id: 109,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_dimension_tags',
            data: {
                rows: res
            }
        });   
    });

    // 多筛选条件搜索听单
    xmly.request({
        url: 'https://api.ximalaya.com/operation/columns',
        type: 'get',
        params: {
            // 
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_columns',
            data: {
                rows: res
            }
        });   
    });

    // 批量获取听单信息
    xmly.request({
        url: 'https://api.ximalaya.com/operation/batch_get_columns',
        type: 'get',
        params: {
            ids: '2402',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_batch_get_columns',
            data: {
                rows: res
            }
        });   
    });

    // 分页获取听单内容
    xmly.request({
        url: 'https://api.ximalaya.com/operation/browse_column_content',
        type: 'get',
        params: {
            ids: '2402',
            // page: 1,
            // count: 20,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_browse_column_content',
            data: {
                rows: res
            }
        });   
    });

    // 多筛选条件搜索专辑
    xmly.request({
        url: 'https://api.ximalaya.com/operation/developer_collected_albums',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_developer_collected_albums',
            data: {
                rows: res
            }
        });   
    });

    // 多筛选条件搜索焦点图
    xmly.request({
        url: 'https://api.ximalaya.com/operation/banners',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#operation_banners',
            data: {
                rows: res
            }
        });   
    });
    
</script>
</body>
</html>

